import { Tabs } from 'antd';
import "../index.less"
import { Link } from 'react-router-dom';
import type { TabsProps } from 'antd';
import PersonalData from './PersonalData';
import { useSelector } from 'react-redux';
import PersonalOrder from './PersonalOrder';
const items: TabsProps['items'] = [
  {
    key: '1',
    label: `个人资料`,
    children: <PersonalData />,
  },
  {
    key: '2',
    label: `订单管理`,
    children: <PersonalOrder />,
  },
];
export default function Individual() {
  const account = useSelector((state: any) => state.account);
  const onChange = (key: string) => {
    console.log(key);
  };
  return (
    <div className='individual common'>
      {
        account ?
          <Tabs className='tabs' tabPosition={"left"} centered={true} defaultActiveKey="1" items={items} onChange={onChange} />
          :
          <div className='out'>
            您还未登录！
            <Link to="/login"><span className='btn'>快去登录吧！</span></Link>
          </div>
      }
      {/* <Tabs className='tabs' tabPosition={"left"} centered={true} defaultActiveKey="1" items={items} onChange={onChange} /> */}
    </div>
  )
}
